package com.tiger.web.config;

import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 配置静态资源映射
 */
//@Configuration
//@EnableWebMvc
public class WebMvcConfig extends WebMvcConfigurerAdapter {

	
	//TODO 添加了反而导致访问不到
	
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //将所有/static/** 访问都映射到classpath:/static/ 目录下
        //registry.addResourceHandler("/resources/**").addResourceLocations("classpath:/WEB-INF/resources/");
        registry.addResourceHandler("/resources/**").addResourceLocations("classpath:/resources/");
        super.addResourceHandlers(registry);
    }
}